﻿using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.IO;


/// <summary>
/// DelUploadFile 的摘要说明
/// </summary>
namespace Web.WebForm.WWW.Files
{
    [WebService(Namespace = "http://www.italki.com")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class DelUploadFile : System.Web.Services.WebService
    {

        public DelUploadFile()
        {

            //如果使用设计的组件，请取消注释以下行 
            //InitializeComponent(); 
        }

        [WebMethod]
        public Boolean UpdateFile(String fileName)
        {
            try
            {
                String file = Server.MapPath("/UploadFiles/" + fileName);

                if (File.Exists(file))
                {
                    File.Delete(file);
                    return true;
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            return false;
        }
    }
}

